<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>系统视图</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="SECT1">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="catalog-pg-type.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="catalogs.html">快退</a></td><td width="60%" align="center" valign="bottom">章43. 系统表</td><td width="10%" align="right" valign="top"><a href="catalogs.html">快进</a></td><td width="10%" align="right" valign="top"><a href="view-pg-cursors.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<div class="SECT1"><h1 class="SECT1"><a name="VIEWS-OVERVIEW">43.35. 系统视图</a></h1>
<p>除了系统表之外，PostgreSQL 还提供了一系列内置的视图。系统视图提供了查询系统表的一些便利的访问方法。其它一些视图提供了访问内部服务器状态的方法。</p>
<p>信息模式(<a href="http://www.jinbuguo.com/postgresql/manual/information-schema.html">章32</a>)提供了另外一套视图，它的功能覆盖了系统视图的功能。因为信息模式是 SQL 标准，而这里描述的视图是 PostgreSQL 特有的，所以最好用信息模式来获取自己需要的所有信息。</p>
<p><a href="views-overview.html#VIEW-TABLE">表43-35</a>列出了这里描述的所有系统视图。下面是每个视图更详细的信息。有些视图提供了对统计收集器的结果的访问；他们在<a href="monitoring-stats.html#MONITORING-STATS-VIEWS-TABLE">表25-1</a>里列出。</p>
<p>除了特别声明的，这里描述的所有视图都是只读的。</p>
<div class="TABLE"><a name="VIEW-TABLE"></a>
<p><b>表43-35. 系统视图</b></p>
<table border="1" class="CALSTABLE"><col><col>
<thead>
<tr><th>视图名</th><th>用途</th></tr>
</thead>
<tbody>
<tr><td><a href="view-pg-cursors.html"><tt class="STRUCTNAME">pg_cursors</tt></a></td><td>打开的游标</td></tr>
<tr><td><a href="view-pg-group.html"><tt class="STRUCTNAME">pg_group</tt></a></td><td>数据库用户的组</td></tr>
<tr><td><a href="view-pg-indexes.html"><tt class="STRUCTNAME">pg_indexes</tt></a></td><td>索引</td></tr>
<tr><td><a href="view-pg-locks.html"><tt class="STRUCTNAME">pg_locks</tt></a></td><td>当前持有的锁</td></tr>
<tr><td><a href="view-pg-prepared-statements.html"><tt class="STRUCTNAME">pg_prepared_statements</tt></a></td><td>预备语句</td></tr>
<tr><td><a href="view-pg-prepared-xacts.html"><tt class="STRUCTNAME">pg_prepared_xacts</tt></a></td><td>预备事务</td></tr>
<tr><td><a href="view-pg-roles.html"><tt class="STRUCTNAME">pg_roles</tt></a></td><td>数据库角色</td></tr>
<tr><td><a href="view-pg-rules.html"><tt class="STRUCTNAME">pg_rules</tt></a></td><td>规则</td></tr>
<tr><td><a href="view-pg-settings.html"><tt class="STRUCTNAME">pg_settings</tt></a></td><td>参数设置</td></tr>
<tr><td><a href="view-pg-shadow.html"><tt class="STRUCTNAME">pg_shadow</tt></a></td><td>数据库用户</td></tr>
<tr><td><a href="view-pg-stats.html"><tt class="STRUCTNAME">pg_stats</tt></a></td><td>规划器统计</td></tr>
<tr><td><a href="view-pg-tables.html"><tt class="STRUCTNAME">pg_tables</tt></a></td><td>表</td></tr>
<tr><td><a href="view-pg-timezone-abbrevs.html"><tt class="STRUCTNAME">pg_timezone_abbrevs</tt></a></td><td>时区缩写</td></tr>
<tr><td><a href="view-pg-timezone-names.html"><tt class="STRUCTNAME">pg_timezone_names</tt></a></td><td>时区名</td></tr>
<tr><td><a href="view-pg-user.html"><tt class="STRUCTNAME">pg_user</tt></a></td><td>数据库用户</td></tr>
<tr><td><a href="view-pg-views.html"><tt class="STRUCTNAME">pg_views</tt></a></td><td>视图</td></tr>
</tbody>
</table>
</div>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="catalog-pg-type.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="view-pg-cursors.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top"><tt class="STRUCTNAME">pg_type</tt></td><td width="34%" align="center" valign="top"><a href="catalogs.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top"><tt class="STRUCTNAME">pg_cursors</tt></td></tr>
</table>
</div>
</body></html>